package com.zhx.learn.controller;

import com.zhx.learn.Entity;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

/**
 *describe: 
 *
 *@author zhanghaixuan
 *@date 2019/03/29
 **/
@RestController
@RequestMapping("/test")
public class MainController {

	@GetMapping("/hi")
	public ResponseEntity hi(@RequestParam String name){
		return  ResponseEntity.ok(name);
	}

	@GetMapping("/hi/{name}")
	public ResponseEntity hiPath(@PathVariable String name){
		return  ResponseEntity.ok(name);
	}

	@RequestMapping(value = "/hipojo",method = RequestMethod.POST)
	public ResponseEntity hipojo(@RequestBody Entity entity){
		return ResponseEntity.ok(entity);
	}
}
